package com.zfxt.util.interceptor;


import com.zfxt.biz.model.User;
//方便user在session中的获取，为每一个线程单独开辟一个空间
public class UserContext {
	private static final ThreadLocal<User> USER_HODLER = new ThreadLocal<>();
    
	public static void setUser(User user){
		USER_HODLER.set(user);
	}
	
	public static void remove(){
		USER_HODLER.remove();
	}
	
	public static User getUser(){
		return USER_HODLER.get();
	}
}
